import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.RandomAccess;

public class Test3 {
    public static void main(String[] args) throws IOException {
        RandomAccessFile raf=new RandomAccessFile("D:\\test.txt","rw");
        int b[]={1,2,3,4};
        for (int i = 0; i < b.length; i++) {
            raf.writeInt(b[i]);
        }
        for (int i = b.length-1; i >= 0; i--) {
            raf.seek(i*4);
            System.out.print(raf.readInt());
        }
        raf.close();
    }
}
